
#ifndef _DEV_PURIFIER_H_
#define _DEV_PURIFIER_H_

#include "sys_port.h"
#include "dev_off.h"
#include "dev_off_line.h"
#include "root.h"

#define PURIFIER_MAX_NUM    (5)

typedef enum purifier_stat
{
	PURIFIER_STAT_STANDBY = 0,    //待机中
	PURIFIER_STAT_WARM,	  	      //保温中
	PURIFIER_STAT_HEAT,           //加热中
	PURIFIER_STAT_WASH,     	  //冲洗中
	PURIFIER_STAT_FILTER, 	  	  //制水中
	PURIFIER_STAT_OUT_WATER,	  //出水中
	PURIFIER_STAT_UV_STERILIZE,	  //UV杀菌中
	PURIFIER_STAT_ERR,	  		  //故障中
}e_purifier_stat;

typedef enum 
{
	PURI_CMD_START = 0,
	PURI_CMD_HEAT,		  //加热
	PURI_CMD_WASH,     	  //冲洗
}e_puri_cmd;

typedef struct 
{
    char  devid[128];
    int   cmd_type;
	int   cmd_data;
}puri_http_req_t;

typedef struct{
	char name[64];
	int  life;
}filter_info_t;

typedef struct 
{
    char devname[128];
    char devid[128];
    char devtype[128];
    char devsubtype[128];

	int  status;         //在线离线状态
	int  workstatus;     //工作状态 

	int  is_exist_heat;      //有无加热
	int  is_exist_wash;      //有无滤芯冲洗
	int  is_exist_intds;     //有无进水tds
	int  is_exist_outtds;    //有无出水tds
	int  is_exist_tds;       //有无tds
	int  is_exist_rofilter;  //有无一体滤芯
	int  filter_num;         //滤芯数量

	filter_info_t  f_info[PURIFIER_MAX_NUM];

	int  wash_status;    //滤芯冲洗状态
	int  heat_status;    //加热状态

	int  jstds;          //进水tds
	int  cstds;          //纯水tds
}ui_puri_data_t;

typedef struct 
{
	lv_obj_t* js;
	lv_obj_t* js_title;

	lv_obj_t* cs;
	lv_obj_t* cs_title;

	lv_obj_t* filter1;
	lv_obj_t* filter2;	
	lv_obj_t* filter3;
}mode1_obj_t;

typedef struct 
{
	lv_obj_t* js;
	lv_obj_t* js_title;

	lv_obj_t* cs;
	lv_obj_t* cs_title;

	lv_obj_t* filter1;
	lv_obj_t* filter_per;
	lv_obj_t* filter_title;
}mode2_obj_t;

typedef struct 
{
	lv_obj_t* filter1;
	lv_obj_t* filter1_per;
	lv_obj_t* filter1_title;

	lv_obj_t* filter2;
	lv_obj_t* filter2_per;
	lv_obj_t* filter2_title;

	lv_obj_t* filter3;
	lv_obj_t* filter3_per;
	lv_obj_t* filter3_title;
}mode3_obj_t;

typedef struct 
{
	lv_obj_t* lab_status;
}mode4_obj_t;

typedef struct 
{
    lv_timer_t * time;
	//****************************
	lv_obj_t* bg_img;
	lv_obj_t* label_status;
	//****************************
	lv_obj_t* wash_btn;
	lv_obj_t* wash_img;
	lv_obj_t* wash_lab;
	//****************************
	lv_obj_t* heat_btn;
	lv_obj_t* heat_img;
	lv_obj_t* heat_lab;
	//****************************
	mode1_obj_t mode1;
	mode2_obj_t mode2;
	mode3_obj_t mode3;
	mode4_obj_t mode4;
	//****************************
	ui_dev_off_t dev_off;
	ui_dev_off_line_t dev_off_line;
	//****************************
}ui_puri_obj_t;

typedef struct 
{
    ui_puri_data_t data;
    ui_puri_obj_t  ui;
}ui_dev_purifier_t;

dev_info_t* dev_purifier_reg(ui_puri_data_t* dev);

page_info_t* dev_puri_page_reg(ui_dev_purifier_t* puri);

#endif
